package com.millstein.tsinglog.model.dto.article;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;
import java.util.List;

/**
 * 保存文章时使用的封装实体
 */
@Data
public class ArticleSaveDTO {

    private Long id;

    @NotBlank
    @Length(max = 50)
    private String articleTitle;

    @NotBlank
    private String articleContent;

    @NotBlank
    private String selectedCoverUrl;

    @NotNull
    private Long selectedCategory;

    @NotNull
    @Max(2)
    @Min(1)
    private Short selectedType;

    @NotNull
    private Short release;

    @NotEmpty
    private List<Long> selectedTag;

    @NotNull
    private Short editorType;

    @NotBlank
    @Length(max = 100)
    private String summary;

    @NotNull
    private Short optionFlag; // 是否需要将此文章对应的轮播图信息进行操作，0不需要，1新增，2修改，3删除
}
